<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"
	scope="session" />
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="<c:url value='/static/themes/js/jquery-1.11.1.min.js'/>"></script>
<title><sitemesh:write property='title' />--天天生财</title>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon"
	href="<c:url value='/static/themes/images/favicon.png'/>"
	type="image/png">
<!-- 需要改颜色可以在style.default.css文件中79行更改对应的值（style.default.css现在是屎黄色）-->
<link href="<c:url value='/static/themes/css/style.default.css'/>"
	rel="stylesheet">
<link href="<c:url value='/static/themes/css/jquery.datatables.css'/>"
	rel="stylesheet">
<link href="<c:url value='/static/themes/css/bootstrap-datetimepicker.min.css'/>" rel="stylesheet" media="screen">
<link
	href="<c:url value='/static/datetimepicker/css/bootstrap-datetimepicker.min.css'/>"
	rel="stylesheet" media="screen">
<link
	href="<c:url value='/static/themes/toastmessage/resources/css/jquery.toastmessage.css'/>"
	rel="stylesheet" media="screen">

<sitemesh:write property='head' />
</head>
<c:set var="path" value="${pageContext.request.contextPath}"></c:set>
<c:set var="menus" value="${session_userInfo.menus}"></c:set>

<script type="text/javascript">
	var path = '${path}';
</script>
<body>
	<div id="preloader">
		<div id="status">
			<i class="fa fa-spinner fa-spin"></i>
		</div>
	</div>
	<section>
		<div class="leftpanel">
			<a href="<c:url value='/' />"><div class="logopanel">
					<h1>
						<span></span>
					</h1>
				</div></a>
			<div class="leftpanelinner">
				<h5 class="sidebartitle">操作菜单</h5>
				<ul class="nav nav-pills nav-stacked nav-bracket">
					<li><a href="<c:url value='/' />"><i class="fa fa-home"></i>
							<span>首页</span></a></li>
					<c:if test="${!empty menus['check1'] }">
						<li><a href="<c:url value='/audit/list'/>"><i
								class="fa fa-users"></i> <span>审核管理</span></a></li>
					</c:if>
					<c:if test="${!empty menus['check2'] }">
						<li class="nav-parent"><a href=""><i class="fa fa-user"></i>
								<span>用户管理</span></a>
							<ul class="children">
								<c:if test="${!empty menus['check3'] }">
									<li><a href="<c:url value='/user/businessUsersList' />"><i
											class="fa fa-caret-right"></i> <span>商家账户管理</span></a></li>
								</c:if>
								<c:if test="${!empty menus['check4'] }">
									<li><a href="<c:url value='/user/buyersUsersList' />"><i
											class="fa fa-caret-right"></i> <span>买手商户管理</span></a></li>
								</c:if>
							</ul></li>
					</c:if>
					<c:if test="${!empty menus['check5'] }">
						<li><a href="${ctx }/task/index"><i class="fa fa-users"></i>
								<span>任务管理</span></a></li>
					</c:if>
					<c:if test="${!empty menus['check6'] }">
						<li><a href="<c:url value='/order/index'/>"><i
								class="fa fa-users"></i> <span>订单管理</span></a></li>
					</c:if>
					<c:if test="${!empty menus['check7'] }">
						<li><a href="<c:url value='/complaints/list'/>"><i
								class="fa fa-users"></i> <span>申述管理</span></a></li>
					</c:if>
					<c:if test="${!empty menus['check8'] }">
						<li class="nav-parent"><a href=""><i class="fa fa-user"></i>
								<span>资金管理</span></a>
							<ul class="children">
								<c:if test="${!empty menus['check9'] }">
									<li><a href="<c:url value='/capital/detailList'/>"><i
											class="fa fa-file-text"></i> <span>平台资金明细</span></a></li>
								</c:if>
								<c:if test="${!empty menus['check10'] }">
									<li><a href="<c:url value='/capital/rechargeDetailList'/>"><i
											class="fa fa-css3"></i> <span>商家充值管理页面</span></a></li>
								</c:if>
								<c:if test="${!empty menus['check11'] }">
									<li><a href="<c:url value='/capital/raiseCashList'/>"><i
											class="fa fa-css3"></i> <span>买手提现管理页面</span></a></li>
								</c:if>
								<c:if test="${!empty menus['check12'] }">
									<li><a href="<c:url value='/capital/crossSection'/>"><i
											class="fa fa-css3"></i> <span>管理员人工划款管理页面</span></a></li>
								</c:if>
							</ul></li>
					</c:if>
					<c:if test="${!empty menus['check13'] }">
						<li><a href="<c:url value='/info/infoList'/>"><i
								class="fa fa-list"></i> <span>消息中心</span></a></li>
					</c:if>
					<c:if test="${!empty menus['check14'] }">
						<li><a href="<c:url value='/announcement/announcementList'/>"><i
								class="fa fa-foursquare"></i> <span>公告管理</span></a></li>
					</c:if>
					<c:if test="${!empty menus['check15'] }">
						<li class="nav-parent"><a href=""><i class="fa fa-maxcdn"></i>
								<span>权限管理</span></a>
							<ul class="children">
								<li><a href="<c:url value='/auth/user/index'/>"><i
										class="fa fa-caret-right"></i> <span>账号权限管理</span></a></li>
								<li><a href="<c:url value='/auth/role/index'/>"><i
										class="fa fa-caret-right"></i> <span>角色权限管理</span></a></li>
							</ul></li>
					</c:if>
					<c:if test="${!empty menus['check16'] }">
						<li><a href="<c:url value='/log/index'/>"><i
								class="fa fa-pagelines"></i> <span>操作日志</span></a></li>
					</c:if>
				</ul>
			</div>
		</div>

		<div class="mainpanel">
			<div class="headerbar">
				<a class="menutoggle" style="width: 0;"></a>
				<div class="text-right"
					style="padding-top: 50px; padfont-size: 17px; padding-right: 20px">
					<span class="panel-stat"><i class="glyphicon glyphicon-user"
						style="font-size: 17px; padding: 7px"></i><span class="stat">你好，${empty session_userInfo.user.nickName?session_userInfo.user.username:session_userInfo.user.nickName }&nbsp;|&nbsp;<span
							id="logout"><span class="glyphicon glyphicon-log-out"></span>&nbsp;退出</span></span>
					</span>
				</div>
			</div>
			<div class="pageheader">
				<h2>
					<i class="fa fa-home"></i> 操作台 <span>可以在此酣畅淋漓</span>
				</h2>
				<div class="breadcrumb-wrapper">
					<span class="label">当前位置:</span>
					<ol class="breadcrumb">
						<li id="first"><a href="<c:url value='/'/>">首页</a></li>
						<li id="second" class="active">欢迎页面</li>
					</ol>
				</div>
			</div>
			<div class="contentpanel">
				<sitemesh:write property='body' />
			</div>
		</div>
	</section>


	<script
		src="<c:url value='/static/themes/js/jquery-migrate-1.2.1.min.js'/>"></script>
	<script
		src="<c:url value='/static/themes/js/jquery-ui-1.10.3.min.js'/>"></script>
	<script src="<c:url value='/static/themes/js/bootstrap.min.js'/>"></script>
	<script src="<c:url value='/static/themes/js/modernizr.min.js'/>"></script>
	<script
		src="<c:url value='/static/themes/js/jquery.sparkline.min.js'/>"></script>
	<script src="<c:url value='/static/themes/js/toggles.min.js'/>"></script>
	<script src="<c:url value='/static/themes/js/retina.min.js'/>"></script>
	<script src="<c:url value='/static/themes/js/jquery.cookies.js'/>"></script>
	<script src="<c:url value='/static/themes/js/morris.min.js'/>"></script>
	<script src="<c:url value='/static/themes/js/raphael-2.1.0.min.js'/>"></script>
	<script src="<c:url value='/static/themes/js/custom.js'/>"></script>
	<script src="<c:url value='/static/themes/js/jquery.gritter.min.js'/>"></script>

	<script type="text/javascript"
		src="<c:url value='/static/datetimepicker/js/bootstrap-datetimepicker.js'/>"
		charset="UTF-8"></script>
	<script type="text/javascript"
		src="<c:url value='/static/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js'/>"
		charset="UTF-8"></script>

	<script type="text/javascript"
		src="<c:url value='/static/jquery/zTree/v3/js/jquery.ztree.core-3.5.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/jquery/zTree/v3/js/jquery.ztree.excheck-3.5.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/jquery/zTree/v3/js/jquery.ztree.exedit-3.5.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/themes/js/jquery.datatables.min.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/jquery/pluploader/plupload.full.min.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/themes/toastmessage/javascript/jquery.toastmessage.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/common/uc_message.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/common/DateFormatUtil.js'/>"></script>
	<script type="text/javascript"
		src="<c:url value='/static/blockui-master/jquery.blockUI.js'/>"></script>
	<script type="text/javascript">
		String.prototype.startWith = function(str) {
			var reg = new RegExp("^" + str);
			return reg.test(this);
		}

		String.prototype.endWith = function(str) {
			var reg = new RegExp(str + "$");
			return reg.test(this);
		}

		var ctx = '<c:url value="/"/>';
		var fullUrl = window.location.href;
		var protocol = window.location.protocol;
		var hostUrl = protocol + "//" + window.location.host + ctx;
		var hasParam = fullUrl.indexOf("?") > -1;

		var servletUrl = hasParam ? fullUrl.substring(0, fullUrl.indexOf("?"))
				: fullUrl;
		var jIndex = fullUrl.indexOf("#");
		if (jIndex == -1)
			jIndex = fullUrl.length;

		var hanldUrl = fullUrl.substring(hostUrl.length, jIndex);
		var hanldUrlPrix = hanldUrl.split("/")[0];

		$(function() {
			var domA;
			var domB;
			$.each($("a"), function(i, n) {
				var aUrl = $(this).attr("href");
				if (!domA && aUrl === (ctx + hanldUrl)) {
					domA = $(this);
				}
				if (!domB && aUrl && aUrl.startWith(ctx + hanldUrlPrix)) {
					domB = $(this);
				}
			});

			if (!domA && domB) {
				domA = domB;
			}

			if (domA) {
				var firstMenu = $(domA).parents(".nav-parent");
				$(domA).parent().addClass("active");
				$(firstMenu).addClass("nav-active");
				$(domA).parents(".children").css("display", "block");

				var firstText = $($(firstMenu).find("a span")[0]).text()
						|| "首页";
				var secondSpans = $(domA).find("span");
				var secondText = $(secondSpans).text();
				if (secondSpans.length > 1)
					secondText = $($(secondSpans)[1]).text();

				$("#first").html(
						'<a href="javascript: void(0);">' + firstText + '</a>');
				$("#second").text(secondText);
			}

			$("#table1_paginate a").click(
					function() {
						var pageno = $(this).attr("pageno");
						var clickable = $(this).attr("clickable");
						if (!clickable)
							return;
						var params = "";
						if (hasParam) {
							var str = fullUrl.substr(servletUrl.length + 1);
							var arr = str.split("&");

							for (var i = 0; i < arr.length; i++) {
								var num = arr[i].indexOf("=");
								if (num > 0) {
									var name = arr[i].substring(0, num);
									var value = arr[i].substr(num + 1);

									if (name === "pageno")
										continue;

									var relationStr = "";
									if (i > 0)
										relationStr = "&";

									params = params + relationStr + name + "="
											+ value;
								}
							}
							window.location.href = servletUrl + "?" + params
									+ "&pageno=" + pageno;
						} else {
							window.location.href = servletUrl + "?pageno="
									+ pageno;
						}
					});

			$("tbody tr td[colspan=10]").css("color", "red");

			$('#logout').click(function() {
				window.location.href = path + "/logout";
			});
		});
	</script>
</body>
</html>
